import ApiBase from './ApiBase'

export default class TaskMangeService extends ApiBase {
    //获取任务管理数据集列表
    async getList(params) {
        let url = '/task/get_list';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
	
	async batchList(params) {
		let url = '/batch/get_list';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	async batch_gdb_list(params) {
		let url = '/batch/get_files_list';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}

    async get_gdb_list(params) {
        let url = '/task/get_gdb_list';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
    //添加任务
    async task_add(params) {
        let url = '/task/add';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
	async batch_add(params) {
		let url = '/batch/add';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	

    //提交任务
    async task_audit(params) {
        let url = '/task/submit_to_audit';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }

    //撤回任务
    async recall_task(params) {
        let url = '/task/recall_submit';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }

    //获取任务右侧列表数据
    async task_contents(params) {
        let url = '/task/get_task_contents';
        let data = params ? params:{};
        const result = await super.request(url,data, true);
        return result;
    }
	//获取任务右侧列表数据
	async task_contentsInfo(params) {
		let url = '/batch/get_data_list';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
    
    //获取任务详情
    async task_detail(params) {
        let url = '/task/get';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }

    //获取上传文件进度列表；
    async task_progressList(params) {
        let url = '/task/get_upload_progressbar';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
	async batch_progressList(params) {
		let url = '/batch/get_upload_progressbar';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}

    //加入待提交列表
    async task_submitList(params) {
        let url = '/task/add_to_submit_list';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }

    //获取数据统计情况；
    async task_statistics(params) {
        let url = '/task/get_statistics';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
    //导出物体库
    async export_shape(params) {
        let url = '/sub_data_set/export_shp';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
    //获取导出进度
    async export_speed(params) {
        let url = '/sub_data_set/get_export_list';
        let data = params ? params:{};
        const result = await super.request(url,data);
        return result;
    }
	
	//新建任务 
	async addTask(params) {
		let url = '/task/add';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//获取任务列表
	async getTask(params) {
		let url = '/task/get_list';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//编辑任务
	async editTask(params) {
		let url = '/task/edit';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//删除任务
	async deleteTask(params){
		let url = '/task/delete';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//将任务提交审核
	async submitAudit(params){
		let url = '/task/submit_to_audit';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//将任务提交审核
	async joinTask(params){
		let url = '/task/add_data_to_task';
		let data = params ? params:{};
		const result = await super.request(url,data);
		return result;
	}
	//任务删除  
	async removeTask(params = {}){
		let url = '/task/remove_data_from_task';
		let data = params;
		const result = await super.request(url,data);
		return result;
	}

	//将任务加入整个批次
	async addAllDataToTask( taskId, batchId ) {
		let url = '/task/add_all_data_to_task';
		let data = {task_id:taskId, batch_id:batchId};
		const result = await super.request(url,data, true);
		return result;
	}

	//删除批次
	async deleteBatch(batchId) {
		let url = '/batch/remove'
		let data = {batch_id:batchId}
		const result = await super.request(url,data, true)
		return result
	}


	
	//驳回任务列表 rejectList
	
	//驳回任务详情 rejectCont
	
}